<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.min.js"></script>
	</head>
	<body>
		<div id="app">
			姓名:{{ fullName}}
		</div>
		<script>
			var app=new Vue({
				el:'#app',
				data:{
					firstName :'Jack', 
					lastName :'Green' 
				},
				computed:{
					fullName:{
						get:function(){
							return this.firstName+' '+this.lastName;				
						},
						set:function(nawValue){
							var names=newValue.split(' ');
							this.firstName=names[0];
							this.lastName=names[names.length-1];
						}
					}
				}
			})
		</script>
	</body>
</html>
